<?php if (!defined('THINK_PATH')) exit();?> <html>
<head>
<title><?php echo ($result["name"]); ?></title>
    <script src="/drclothes/Public/js/jquery.min.js"></script>    
    <script src="/drclothes/Public/js/bootstrap.min.js"></script>  
    <link href="/drclothes/Public/css/bootstrap.min.css" rel="stylesheet">
    <link href="/drclothes/Public/css/animate.min.css" rel="stylesheet">
    <link href="/drclothes/Public/css/style.css" rel="stylesheet">
</head>
<body>
    
<div class="container-fluid background2">
    <div class="container">
		<div class="row clearfix">
			<div class="col-xs-6 column color1">
				<h3>Drclothes特产专卖</h3>
			</div>
			<div class="col-xs-6 column color1" align="right">
			   <?php
 if(!isset($_SESSION['username'])){ echo'<h5 style="line-height:37px;"><a href="/drclothes/index.php/home/form/login"><font>登录</font></a>&nbsp;|&nbsp;<a href="/drclothes/index.php/home/form/register"><font>注册</font></a></h5>'; } else{ $username= $_SESSION['username']; $userrank= $_SESSION['userrank']; echo "<h5 style='line-height:37px;'><font>你好,".$username."~".$userrank."</font>&nbsp;|&nbsp;<a href='/drclothes/index.php/home/form/logout'><font>退出</font></h5>"; } ?>
			</div>
		</div>
	</div>
</div>
<div class="container-fluid background5">
<div class="container">
	<div class="row clearfix">
		<div class="col-xs-12 column padding3">
			<div class="row clearfix">
                <div class="col-xs-1 column" align="center">
                    <a href="/drclothes/index.php"><img src="/drclothes/Public/image/logo.jpg" class="img-responsive"></a>
                </div>
                <div class="col-xs-1 column" align="center">
                    <a href="/drclothes/index.php/home/form/searchresult?name=项链">项链</a>
                </div>
                <div class="col-xs-1 column" align="center">
                    <a href="/drclothes/index.php/home/form/searchresult?name=戒">戒指</a>
                </div>
                <div class="col-xs-1 column" align="center">
                    <a href="/drclothes/index.php/home/form/searchresult?name=耳">耳环</a>
                </div>
                <div class="col-xs-1 column" align="center">
                    <a href="/drclothes/index.php/home/form/searchresult?name=手">手镯</a>
                </div>
                <div class="col-md-offset-3 col-xs-3 column" align="center">
                    <form role="search" class="form-horizontal" action="/drclothes/index.php/home/form/searchresult" method="get" style="margin-bottom:0px;">
                        <div class="input-group">
                            <input id="query" name="name" type="text" placeholder="搜索 商品..." class="form-control" required />
                            <span class="input-group-btn">
                                <button class="btn button2 glyphicon glyphicon-search" type="submit" style="top:0px;"></button>
                            </span>
                        </div>
                    </form>
                </div>
                <div class="col-xs-1 column" align="right">
                    <a href="/drclothes/index.php/home/form/cart" class="glyphicon glyphicon-shopping-cart" title="购物车"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<a href="/drclothes/index.php/home/form/orderlist" class="glyphicon glyphicon-tags"  title="我的订单"></a>
                </div>
            </div>
		</div>
	</div>
</div>
</div>


						<div class="container">
							<div class="row clearfix">
								<div class="col-xs-6 column padding1" align="center">
									<img src="/drclothes/Public/<?php echo ($result["img"]); ?>" class="img-responsive ">
								</div>
								<div class="col-xs-6 column margin1 padding10">
									<form class="form-horizontal"  method="POST"  action="/drclothes/index.php/home/form/addcart">
										<fieldset>

										<!-- 表单名称 -->
										<div class="form-group">
										  <label class="col-md-4 control-label">名称</label>
										  <label class="col-md-8  control-label" style="text-align:left;"><?php echo ($result["name"]); ?></label>
										</div>	
										<div class="form-group">
										  <label class="col-md-4 control-label">价格</label>
										  <label class="col-md-8  control-label" style="text-align:left;">￥<?php echo ($result["price"]); ?></label>
										</div>
										<div class="form-group">
										  <label class="col-md-4 control-label">描述</label>
										  <label class="col-md-8  control-label" style="text-align:left;"><?php echo ($result["description"]); ?></label>
										</div>
										<div class="form-group">
										  <label class="col-md-4 control-label" for="radios">贵重物品险</label>
										    <div class="col-md-8">
												<select id="baoxian" name="baoxian" class="form-control" onchange="">
							                        <option value="0" id="type0">无保险</option>
							                        <option value="10" id="type1">10元险最高报销10万元</option>
							                        <option value="30" id="type2">30元险最高报销50万元</option>
						                        </select>
											</div>
										</div>
										<div class="form-group">
										  <label class="col-md-4 control-label">总价</label>
										  <label class="col-md-8  control-label" style="text-align:left;" id="zongjia"></label>
										</div>
										<?php
 if(!isset($_SESSION['username'])){ echo'
										<!-- 按钮 -->
										<div class="form-group">
										  <label class="col-md-4 control-label" for="singlebutton">提交</label>
										  <div class="col-md-8">
										    <a href="/drclothes/index.php/home/form/login"><input id="singlebutton" name="singlebutton" class="btn btn-primary" value="请登录后购买"></a>
										  </div>
										</div>'; } else{ echo'<input type="hidden" id="drclothesid" class="form-control" name="drclothesid" value="'.$result['id'].'">
											<input type="hidden" id="username" class="form-control" name="username" value="'.$_SESSION['username'].'">
											<input type="hidden" id="userurl" class="form-control" name="userurl" value="'.$_SERVER['REQUEST_URI'].'">
											<input type="hidden" id="name" class="form-control" name="name" value="'.$result['name'].'">
											<input type="hidden" id="price" class="form-control" name="price" value="'.$result['price'].'">
										<!-- 按钮 -->
										<div class="form-group">
										  <label class="col-md-4 control-label" for="singlebutton">提交</label>
										  <div class="col-md-8">
										    <input id="singlebutton" type="submit" name="singlebutton" class="btn btn-primary" style="background-color:#444;border-color:#444;"  value="购买">
										  </div>
										</div>'; }?>
										</fieldset>
									</form>
								</div>
							</div>
						</div>
						<!-- <div class="container-fluid" style="background:url('/drclothes/Public/<?php echo ($result["img2"]); ?>') #ffffff no-repeat fixed;min-height: 1080px;">
							<div class="row clearfix">
								<div class="col-xs-offset-1 col-xs-11 column margin1">
									<img src="/drclothes/Public/<?php echo ($result["img3"]); ?>" class="img-responsive">
								</div>
							</div>
						</div>
						<div class="container-fluid">
							<div class="row clearfix">
								<div class="col-xs-12 column margin1 padding1" align="center">
									<img src="/drclothes/Public/<?php echo ($result["img4"]); ?>" class="img-responsive">
								</div>
							</div>
						</div> -->
						<div class="container">
							<div class="row clearfix">
								
							</div>
						</div>;
 
<div class="container">
    <div class="row clearfix">
        <div class="col-xs-12 column margin1 padding1">
            <form class="form-horizontal">
                <fieldset>
                <!-- 表单名称 -->
                <legend class="text-center">评论列表</legend>
                <?php if(is_array($comment)): $k = 0; $__LIST__ = $comment;if( count($__LIST__)==0 ) : echo "$empty" ;else: foreach($__LIST__ as $key=>$commentitem): $mod = ($k % 2 );++$k;?><div class="panel panel-default">
                    <div class="panel-heading">
                        <h3 class="panel-title"><?php echo ($commentitem["username"]); ?>发表于<?php echo ($commentitem["addtime"]); ?>：</h3>
                    </div>
                    <div class="panel-body">
                        <?php echo ($commentitem["comment"]); ?>
                    </div>
                </div><?php endforeach; endif; else: echo "$empty" ;endif; ?>
                </fieldset>
            </form>
        </div>
        <div class="col-xs-12 column margin1 padding1" align="center">
            <form class="form-horizontal"  method="POST"  action="/drclothes/index.php/home/form/addcomment">
                <fieldset>

                <!-- 表单名称 -->
                <legend>发表评论</legend>
                <?php
 if(!isset($_SESSION['username'])){ echo'<p>请登录后发表评论！</p>';} else{ echo'<input type="hidden" id="drclothesid" class="form-control" name="drclothesid" value="'.$result['id'].'">
                <input type="hidden" id="username" class="form-control" name="username" value="'.$_SESSION['username'].'">
                <div class="form-group">
                <textarea class="form-control" rows="3" name="comment" placeholder="说点什么..."></textarea>
                </div>
                <div class="form-group">
                    <label class="col-md-4 control-label" for="singlebutton">提交</label>
                    <div class="col-md-4">
                    <input id="singlebutton" type="submit" class="btn btn-primary" value="提交评论">
                    </div>
                </div>
                ';} ?>
                </fieldset>
            </form>
        </div>
    </div>
</div>


<div class="container-fluid background2">
<div class="container">
	<div class="row clearfix">
		<div class="col-xs-12 column color1 padding3" align="center">
		    <img src="/drclothes/Public/image/logo.jpg" class="img-responsive">
			<h5>Drclothes（股份代号：1929）· 香港主板上市公司</h5>
			<h5>Copyright © 2016大连东软Drclothes公司版权所有 辽B2-20110210 辽ICP备 11010408号-4</h5>
		</div>
	</div>
</div>	
</div>
</body>
</html>
<script type="text/javascript">
$(document).ready(function(){
	$("#zongjia").html("￥<?php echo ($result["price"]); ?>");
    $("#baoxian").change(function() {
    	var val = $(this).find("option:selected").val();
    	if (val==0) 
    		$("#zongjia").html("￥<?php echo ($result["price"]); ?>");
        else if (val==10)
        	$("#zongjia").html("￥<?php echo ($result["price"]); ?>+10");
        else if (val==30)
        	$("#zongjia").html("￥<?php echo ($result["price"]); ?>+30");
    });
})
</script>